package com.example.multidatasource.generator.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName product
 */
@TableName(value ="product")
@Data
public class Product implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品分类（ProductInternal/ExternalCategoryEnum）
这里直接影响着订单属于什么订单
     */
    @TableField(value = "category_id")
    private Integer categoryId;

    /**
     * 标题
     */
    @TableField(value = "title")
    private String title;

    /**
     * 封面图片oss名称
     */
    @TableField(value = "cover_name")
    private String coverName;

    /**
     * 阿里云视频id
     */
    @TableField(value = "aliyun_video_id")
    private String aliyunVideoId;

    /**
     * 视频封面
     */
    @TableField(value = "video_cover_name")
    private String videoCoverName;

    /**
     * 原始价格（分）
     */
    @TableField(value = "original_price")
    private Integer originalPrice;

    /**
     * 实际价格（分）
     */
    @TableField(value = "actual_price")
    private Integer actualPrice;

    /**
     * 促销说明
     */
    @TableField(value = "promotion")
    private String promotion;

    /**
     * 产品描述（HTML）
     */
    @TableField(value = "description")
    private String description;

    /**
     * 是否需要快递
     */
    @TableField(value = "delivery")
    private Boolean delivery;

    /**
     * 每次下单最大购买数量
     */
    @TableField(value = "max_per_buy_amount")
    private Integer maxPerBuyAmount;

    /**
     * 最大总购买数量
     */
    @TableField(value = "max_total_buy_amount")
    private Integer maxTotalBuyAmount;

    /**
     * 在设定的时间后上线，为空表示立即上线
     */
    @TableField(value = "online_time")
    private Date onlineTime;

    /**
     * 在设定的时间后下线，为空表示不下线
     */
    @TableField(value = "offline_time")
    private Date offlineTime;

    /**
     * 排序权重
     */
    @TableField(value = "sequence")
    private Integer sequence;

    /**
     * 会员返现比例
     */
    @TableField(value = "sales_ratio")
    private Integer salesRatio;

    /**
     * 是否上架教师端
     */
    @TableField(value = "is_teacher")
    private Boolean isTeacher;

    /**
     * 是否教师会员特供
     */
    @TableField(value = "is_teacher_membership")
    private Boolean isTeacherMembership;

    /**
     * 是否允许推荐给学生
     */
    @TableField(value = "allow_student")
    private Boolean allowStudent;

    /**
     * 是否自动推荐给学生
     */
    @TableField(value = "auto_allow_student")
    private Boolean autoAllowStudent;

    /**
     * 
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Product other = (Product) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getCategoryId() == null ? other.getCategoryId() == null : this.getCategoryId().equals(other.getCategoryId()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getCoverName() == null ? other.getCoverName() == null : this.getCoverName().equals(other.getCoverName()))
            && (this.getAliyunVideoId() == null ? other.getAliyunVideoId() == null : this.getAliyunVideoId().equals(other.getAliyunVideoId()))
            && (this.getVideoCoverName() == null ? other.getVideoCoverName() == null : this.getVideoCoverName().equals(other.getVideoCoverName()))
            && (this.getOriginalPrice() == null ? other.getOriginalPrice() == null : this.getOriginalPrice().equals(other.getOriginalPrice()))
            && (this.getActualPrice() == null ? other.getActualPrice() == null : this.getActualPrice().equals(other.getActualPrice()))
            && (this.getPromotion() == null ? other.getPromotion() == null : this.getPromotion().equals(other.getPromotion()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getDelivery() == null ? other.getDelivery() == null : this.getDelivery().equals(other.getDelivery()))
            && (this.getMaxPerBuyAmount() == null ? other.getMaxPerBuyAmount() == null : this.getMaxPerBuyAmount().equals(other.getMaxPerBuyAmount()))
            && (this.getMaxTotalBuyAmount() == null ? other.getMaxTotalBuyAmount() == null : this.getMaxTotalBuyAmount().equals(other.getMaxTotalBuyAmount()))
            && (this.getOnlineTime() == null ? other.getOnlineTime() == null : this.getOnlineTime().equals(other.getOnlineTime()))
            && (this.getOfflineTime() == null ? other.getOfflineTime() == null : this.getOfflineTime().equals(other.getOfflineTime()))
            && (this.getSequence() == null ? other.getSequence() == null : this.getSequence().equals(other.getSequence()))
            && (this.getSalesRatio() == null ? other.getSalesRatio() == null : this.getSalesRatio().equals(other.getSalesRatio()))
            && (this.getIsTeacher() == null ? other.getIsTeacher() == null : this.getIsTeacher().equals(other.getIsTeacher()))
            && (this.getIsTeacherMembership() == null ? other.getIsTeacherMembership() == null : this.getIsTeacherMembership().equals(other.getIsTeacherMembership()))
            && (this.getAllowStudent() == null ? other.getAllowStudent() == null : this.getAllowStudent().equals(other.getAllowStudent()))
            && (this.getAutoAllowStudent() == null ? other.getAutoAllowStudent() == null : this.getAutoAllowStudent().equals(other.getAutoAllowStudent()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCategoryId() == null) ? 0 : getCategoryId().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getCoverName() == null) ? 0 : getCoverName().hashCode());
        result = prime * result + ((getAliyunVideoId() == null) ? 0 : getAliyunVideoId().hashCode());
        result = prime * result + ((getVideoCoverName() == null) ? 0 : getVideoCoverName().hashCode());
        result = prime * result + ((getOriginalPrice() == null) ? 0 : getOriginalPrice().hashCode());
        result = prime * result + ((getActualPrice() == null) ? 0 : getActualPrice().hashCode());
        result = prime * result + ((getPromotion() == null) ? 0 : getPromotion().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getDelivery() == null) ? 0 : getDelivery().hashCode());
        result = prime * result + ((getMaxPerBuyAmount() == null) ? 0 : getMaxPerBuyAmount().hashCode());
        result = prime * result + ((getMaxTotalBuyAmount() == null) ? 0 : getMaxTotalBuyAmount().hashCode());
        result = prime * result + ((getOnlineTime() == null) ? 0 : getOnlineTime().hashCode());
        result = prime * result + ((getOfflineTime() == null) ? 0 : getOfflineTime().hashCode());
        result = prime * result + ((getSequence() == null) ? 0 : getSequence().hashCode());
        result = prime * result + ((getSalesRatio() == null) ? 0 : getSalesRatio().hashCode());
        result = prime * result + ((getIsTeacher() == null) ? 0 : getIsTeacher().hashCode());
        result = prime * result + ((getIsTeacherMembership() == null) ? 0 : getIsTeacherMembership().hashCode());
        result = prime * result + ((getAllowStudent() == null) ? 0 : getAllowStudent().hashCode());
        result = prime * result + ((getAutoAllowStudent() == null) ? 0 : getAutoAllowStudent().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", categoryId=").append(categoryId);
        sb.append(", title=").append(title);
        sb.append(", coverName=").append(coverName);
        sb.append(", aliyunVideoId=").append(aliyunVideoId);
        sb.append(", videoCoverName=").append(videoCoverName);
        sb.append(", originalPrice=").append(originalPrice);
        sb.append(", actualPrice=").append(actualPrice);
        sb.append(", promotion=").append(promotion);
        sb.append(", description=").append(description);
        sb.append(", delivery=").append(delivery);
        sb.append(", maxPerBuyAmount=").append(maxPerBuyAmount);
        sb.append(", maxTotalBuyAmount=").append(maxTotalBuyAmount);
        sb.append(", onlineTime=").append(onlineTime);
        sb.append(", offlineTime=").append(offlineTime);
        sb.append(", sequence=").append(sequence);
        sb.append(", salesRatio=").append(salesRatio);
        sb.append(", isTeacher=").append(isTeacher);
        sb.append(", isTeacherMembership=").append(isTeacherMembership);
        sb.append(", allowStudent=").append(allowStudent);
        sb.append(", autoAllowStudent=").append(autoAllowStudent);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}